POWDER Wrapper
Ein Autohotkey-Script, welches die SDL-Version des Rogue-ähnlichen Spiels POWDER unter Windows etwas bequemer macht.
Voraussetzungen: Autohotkey, POWDER
Das Script einfach in das POWDER-Verzeichnis kopieren und das Spiel mit Hilfe des Scripts starten. Folgende Änderungen stehen jetzt zur Verfügung:
- Shift+Cursortaste bedeutet Swap (sonst Shift+S, Cursortaste)
- Alt+Cursortaste bedeutet Jump (sonst Shift+J, Cursortaste)
- Bosskey: Ende (Spiel wird minimiert)
- Globales Hotkey: Windows+Ende minimiert das Spiel / stellt es wieder her
- Position und Größe des Spielfensters werden gespeichert und wieder hergestellt
- Das Kommandozeilenfenster wird komplett versteckt
- Mehr Übersicht: Die mitgelieferten Textdateien werden in einen Ordner Docs einsortiert
- Bei Spielende wird der Heldendump ausgewertet (sofern vorhanden) und in einen der Ordner heroes oder losers einsortiert.
#SingleInstance Ignore
POWDER = POWDER ahk_class SDL_app
ifNotExist, doc
FileCreateDir, doc
ifExist, CREDITS.TXT
FileMove, CREDITS.TXT, doc
ifExist, LICENSE.TXT
FileMove, LICENSE.TXT, doc
ifExist, README.TXT
FileMove, README.TXT, doc
Run, Powder.exe,, Hide, PID
WinWait, %POWDER%
IniRead, X, settings.ini, Settings, X, E
IniRead, Y, settings.ini, Settings, Y, E
IniRead, W, settings.ini, Settings, W, E
IniRead, H, settings.ini, Settings, H, E
ifEqual, X, E, Goto GoOn
ifEqual, Y, E, Goto GoOn
ifEqual, W, E, Goto GoOn
ifEqual, H, E, Goto GoOn
WinMove, %POWDER%,, %X%, %Y%, %W%, %H%
GoOn:
Loop
{
ifWinNotExist, %POWDER%
Break
WinGetPos, X, Y, W, H, %POWDER%
Sleep, 500
}
IniWrite, %X%, settings.ini, Settings, X
IniWrite, %Y%, settings.ini, Settings, Y
IniWrite, %W%, settings.ini, Settings, W
IniWrite, %H%, settings.ini, Settings, H
Loop, *.txt
{
Physical =
Depth =
Loop, read, %A_LoopFileFullPath%
{
f := RegExMatch(A_LoopReadLine, "Physical: (\d+)/\d+ \(max \d+\)", r)
if (f > 0)
Physical := r1
f := RegExMatch(A_LoopReadLine, "Depth: (\d+)", r)
if (f > 0)
Depth := r1
}
if (Depth == 0)
{
ifNotExist, heroes
FileCreateDir, heroes
FileMove, %A_LoopFileFullPath%, heroes
Continue
}
if (Physical <= 0)
{
ifNotExist, losers
FileCreateDir, losers
FileMove, %A_LoopFileFullPath%, losers
Continue
}
}
ExitApp
; Boss Key
#IfWinExist, POWDER ahk_class SDL_app
#End::
WinGet, Stat, MinMax, %POWDER%
if (Stat == -1)
{
WinRestore, %POWDER%
WinActivate, %POWDER%
}
else
WinMinimize, %POWDER%
return
#IfWinActive, POWDER ahk_class SDL_app
End::
WinMinimize, %POWDER%
return
; Fast Switch Places
*+Right::
Send, +S
Send, {Right}
return
*+Left::
Send, +S
Send, {Left}
return
*+Down::
Send, +S
Send, {Down}
return
*+Up::
Send, +S
Send,{Up}
return
; Fast Jump
*!Right::
Send, +J
Send, {Right}
return
*!Left::
Send, +J
Send, {Left}
return
*!Down::
Send, +J
Send, {Down}
return
*!Up::
Send, +J
Send,{Up}
return

